Skip to content

Add a PDESystem front end for frequency-domain Maxwell - #82

Open
xtalax-droid wants to merge 31 commits into
maxwell/1-corefrom
maxwell/9-frontend-f1
Open

xtalax-droid wants to merge 31 commits into
maxwell/1-corefrom
maxwell/9-frontend-f1

Conversation

@xtalax-droid

Copy link
Copy Markdown
Collaborator

Depends on #74 (this PR targets its branch) and SciML/PDEBase.jl#164.

Summary

A PDESystem front end for the frequency-domain Maxwell model of #74. With
FEMDiscretization(Ω, t; omega, spaces = Dict(E => Nedelec{RefTetrahedron, 1}())), discretize reads the
time-domain equation

curl(ν curl E) + a₂ ∂ₜ²E + a₁ ∂ₜE + a₀ E = f

for a vector unknown @variables E(..)[1:3] off PDEBase's strong-form analysis, samples the coefficients per
cell, and returns the complex LinearProblem that driven_problem builds for the equivalent MaxwellModel
(with ε0 = μ0 = 1). It bypasses the scalar weak form, assembly and DAE path entirely.

@parameters x y z t
@variables E(..)[1:3]
X, Ev, Dt = (x, y, z), [E(t, x, y, z)[c] for c in 1:3], Differential(t)
cc = curl(curl(Ev, X) / μr, X)
eqs = [cc[c] + εr * Dt(Dt(Ev[c])) + σ * Dt(Ev[c]) ~ f[c] for c in 1:3]
pec = reduce(vcat, [cross(facet_normal(Γ), [E(t, Γ)[c] for c in 1:3]) .~ 0 for Γ in boundarypieces(Ω)])
@named sys = PDESystem(eqs, pec, [t ∈ Interval(0.0, 1.0), (x, y, z) ∈ Ω], [t, x, y, z], [E(t, x, y, z)])
prob = discretize(sys, FEMDiscretization(Ω, t; omega = 2.0, spaces = Dict(E => Nedelec{RefTetrahedron, 1}())))

How the operator is recognised

The flux tensor B[e,a,c,b] = ∂flux[e][a]/∂G[c,b] of StrongForm.analyse must be
ν(δ_eb δ_ac − δ_ec δ_ab) with one scalar ν(x). It is decomposed into its three isotropic parts and
checked at every cell centroid (the same points the materials are sampled at), which also words the errors: a vector Laplacian, a grad div term
(including the expanded ∂ᵢ∂ⱼEⱼ − ΔEᵢ), an anisotropic second-order part, first-order terms, cross-component
or anisotropic reaction terms, nonlinear terms, time-dependent coefficients or sources, field-free sources inside a derivative and time
derivatives nested in spatial ones each get their own message; nothing in the analysed equation is dropped
silently. Before the analysis, Dt(E) and Dt(Dt(E)) are replaced by two frequency symbols, and the reaction
coefficient is split in them into a₀ + s₁a₁ + s₂a₂. Each cell gets MaxwellMaterial(eps_r = a₂ − a₀/ω², mu_r = 1/ν, sigma = a₁) at its centroid; the load is ∫ f ⋅ Nᵢ.

The perfect conductor n × E = 0 is recognised from the conditions on each piece: linear in the traces, with zero data, and at the actual outward normal of every facet of the piece
tangential (C n = 0) and of rank 2, so cross(n, E) and cross(E, n) are both accepted
and a single component, a single row of the cross product, inhomogeneous data or a derivative are rejected.
Pieces with no condition get the natural n × (ν curl E) = 0.

Additions to the #74 core (additive only)

  • MaxwellModel(grid; materials = ::Vector{MaxwellMaterial}), one material per cell.
  • driven_problem(model, ω; load), a raw load vector instead of a current density.
  • FEMDiscretization(…; omega); DAEProblem, NonlinearProblem, symbolic_discretize and operators
    reject it. A Nédélec space without omega is rejected at construction.
  • curl(F, (x, y, z)) is a method of Ferrite's (Tensors') curl, re-exported, so using FiniteElementMethod, Ferrite has one curl. QA treats it as owned (piracy) and ignores its non-owner import.
  • facet_normal(Γ) wraps PDEBase.normal(Γ) under a name that does not clash with DomainSets' normal.
  • maxwell_model(pdesys, disc) -> (; model, omega, load) exposes the model, for
    MaxwellSolution(model, omega, sol.u) and field_values.

Limitations

  • Coefficients are real: a complex permittivity ε' − iε'' has no real time-domain form here and stays on
    the operator-level path.
  • Only Nedelec{RefTetrahedron, 1}() is accepted.
  • Only the perfect conductor is a boundary condition; absorbing conditions and ports come in a follow-up.
  • The source is read as a time-independent phasor amplitude; t must still be paired with an interval.

Tests (test/Maxwell/frontend.jl)

  • Oracle: a two-material cube (piecewise ν, εr and σ in x) with PEC on all faces gives the operator-level
    driven_problem matrix exactly (relative difference 0.0) and its load to 1.1e-16; a case with parameters, a
    reaction term a₀ and conductivity matches to 1e-12 too.
  • Manufactured PEC cavity on the unit cube: H(curl) errors 1.72, 0.870, 0.436 at n = 4, 8, 16 (rates 0.98,
    1.00), evaluated through MaxwellSolution and field_values.
  • Every rejection path has a test of its message.

Without SciML/PDEBase.jl#164 the PEC cases cannot be written: the oracle test runs without PEC (natural
boundary everywhere), and the PEC cavity and boundary-condition tests are @test_skipped, so CI on the
released PDEBase stays green.


🤖 Posted by an AI agent · harness: Claude Code 2.1.318 · model: claude-opus-5-5
Review: unreviewed
Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5

t and others added 4 commits November 6, 2026 00:42
FEMDiscretization(Ω, t; omega, spaces = Dict(E => Nedelec{RefTetrahedron, 1}())) now makes discretize read the time-domain curl-curl equation for a vector unknown off PDEBase's strong-form analysis, check its flux tensor is curl(ν curl E), sample the coefficients per cell and return the complex LinearProblem of the equivalent MaxwellModel. The perfect conductor n × E = 0 is written with facet_normal (PDEBase#164). Additive core methods: per-cell materials for MaxwellModel and a raw-load driven_problem. The operator-level model is the test oracle.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…r Nedelec spaces

Codex r1: the component, isotropy and first-order checks ran at four sampled centroids, so a term confined to an unsampled region (h(x) E_2 in one equation) was silently dropped. They now run at every cell centroid, the same points the materials are sampled at, for three frequency-slot values; nonlinearity, time dependence and nonlinearity in the time derivatives are checked symbolically. A Nedelec space other than Nedelec{RefTetrahedron, 1}() is rejected instead of being replaced by it.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Codex r2: a second derivative of a field-free expression lands in the StrongForm flux, which only its E-derivatives were read from, so it vanished from the load. Now the flux at E = 0 must be symbolically zero, flux, remainder and mass may not hold Hessian or time-derivative slots, time derivatives inside spatial derivatives are rejected (in the phasor walk, and as any frequency dependence of the second- and first-order coefficients), and the PEC data at E = 0 must be symbolically zero rather than at three sampled normals. Each case is rejected with its own message.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Codex r3: the rank and tangentiality checks of the PEC conditions ran at three generic normals, so n[1] .* cross(n, E) .~ 0 on the cube's top face (n[1] = 0 there, no constraint) was imposed as full PEC. The linear map from the trace to the residuals is now evaluated at the outward normal of every facet of the piece, and must have rank 2 with n in its null space, i.e. be equivalent to n × E = 0 there.

Agent-Harness: Claude Code 2.1.318
Agent-Model: claude-opus-5-5
Agent-Session: ee6a670e-e4ec-446c-b941-3ebb999c45c5
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.319
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
master ddd2dc3... master / ddd2dc3...
construction/heat P1 10x10 4.27 ± 0.5 ms 3.93 ± 0.23 ms 1.09 ± 0.14
construction/heat P1 20x20 5.44 ± 0.52 ms 5.8 ± 0.7 ms 0.939 ± 0.14
time_to_load 3.53 ± 0.095 s 3.58 ± 0.099 s 0.986 ± 0.038
Memory benchmarks
master ddd2dc3... master / ddd2dc3...
construction/heat P1 10x10 0.0396 M allocs: 2.12 MB 0.0396 M allocs: 2.12 MB 1
construction/heat P1 20x20 0.0704 M allocs: 4.74 MB 0.0704 M allocs: 4.74 MB 1
time_to_load 0.201 k allocs: 12.2 kB 0.201 k allocs: 12.2 kB 1

t and others added 5 commits November 10, 2026 20:13
Resolve conflicts against the master sync of maxwell/1-core.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The coupling tolerance was 1e-10 times the larger of the second-order and zeroth-order coefficients, so a large nu silently hid a coupling of the components of E in the zeroth-order term. It is now relative to the zeroth-order coefficients alone.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
… against nu

The first-order checks used 1e-10 times the larger second-order or zeroth-order coefficient, so a first-order term of size 1 next to nu = 1e12 passed validation and was dropped from the model. No first-order term is allowed, so only roundoff (10 eps) of those coefficients is tolerated.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The second-order checks used a tolerance that included the zeroth-order coefficients, so a large reaction coefficient hid a component-wise Laplacian beside curl(nu*curl(E)). The tolerance is now relative to the second-order coefficients alone.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Conflicts in src/maxwell/model.jl resolved keeping both sides; on 2-eigen the facet table also covers the linear Lagrange space used by the eigen solver.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1c8d2-99a9-7190-bb3c-beb132d84711, reviewed head 21a4fe9

  • Verdict: CHANGES
  • Risk assessment: medium (M1: adds a method of Ferrite/Tensors.curl on foreign AbstractVector/NTuple argument types, affecting another package's dispatch).
  • Round / slot: 1 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

Risk

medium (M1: adds a method of Ferrite/Tensors.curl on foreign AbstractVector/NTuple argument types, affecting another package's dispatch).

Blocking findings

  1. [P2] First-order operators can silently disappear. src/maxwell/frontend.jl:178–181 scales the first-order rejection threshold by the unrelated zeroth-order coefficients. Confirmed by running: on a two-cell-per-side cube, use ν = 1, a₀ = 4e16, a₂ = 1e16 and ω = 2, then add Differential(x)(Eᶜ) to each equation. The frontend accepts it and produces a matrix and load exactly equal to those produced without that derivative: both difference norms are 0.0. Here a₀ − ω²a₂ = 0, so the omitted derivative is a leading operator, despite being below the threshold at the recognition samples. Its explicit coefficient is exactly 1; rounding of a separate reaction coefficient does not justify dropping it. Check discarded first-order coefficients independently, preferably with symbolic zero checks, and add a rejection regression with cancelling reaction/time terms.

  2. [P2] Coupling and anisotropy checks can accept a different equation, with a demonstrably wrong solution. src/maxwell/frontend.jl:184–197 compares couplings and component differences against large sampled diagonal coefficients, then retains only the first equation's scalar coefficient. Confirmed by running: with ν = 1, a₀ = 4e12, a₂ = 1e12 and ω = 2, adding E[mod1(c + 1, 3)] or its first time derivative produces exactly the same matrix and load as omitting the coupling. Component-dependent reactions c * E[c] are also accepted.

    An independent solution probe makes the error concrete: set a₀ = 4e12 + 1 instead, keep a₂ = 1e12 and ω = 2, and use source (1, 0, 0) with natural boundaries. The actual constant-field equation is (I + C)E = (1, 0, 0), where C(E₁,E₂,E₃) = (E₂,E₃,E₁). Its exact solution is (0.5, 0.5, -0.5). The emitted problem gives approximately (1, 0, 0); the measured relative field error is 1.0000000000000104. Reject nonzero nonscalar coefficients independently of the large terms that can cancel at the requested frequency, and add this cancellation case to the rejection tests.

Non-blocking findings

  • src/discretization.jl:186: positive finite BigFloat frequencies 1e-400 and 1e400 pass validation but are stored as 0.0 and Inf, respectively. Confirmed by constructor probes. Validate the converted Float64 value or retain the input precision.
  • test/Maxwell/frontend.jl:275: the comment's Codex r3 label narrates review history. Remove the label and retain the explanation of the geometric condition, following the supplied present-tense comment rule.

What I ran

Independent AI review by codex-cli 0.164.0, model gpt-6.1-sol; the Session above is the actual local session ID (no session URL). Tests ran against an exact git archive HEAD snapshot in scratch/head, preserving the supplied layered JULIA_DEPOT_PATH and requested TMPDIR. Julia used four threads and four precompile tasks, inside memory-capped scopes. The original checkout stayed clean.

  • julia --version: 1.13.2. Pkg.instantiate(; allow_autoprecomp=false) succeeded. Resolved versions included Ferrite 1.7.0, PDEBase 0.1.41, ModelingToolkit 11.46.1, Symbolics 7.48.0 and SciMLBase 3.58.0. The repository has no Manifest.toml.
  • Separately for GROUP=Maxwell, GROUP=Frontend and GROUP=QA, ran julia --project --startup-file=no -e 'using Pkg; Pkg.test(; julia_args=["--threads=4", "--gcthreads=1"])'. All three exited 0:
    • Maxwell: 150 passed, 2 skipped (reported as Broken by Test).
    • Frontend: 782 passed, across 22 files.
    • QA: 21 passed.
  • scratch/probes.jl, executed with the same project: confirmed both blocking findings and the frequency-conversion issue; final run exited 0. The independent constant-field SI check had relative error 8.399186212492177e-13 and maximum physical curl norm 1.1546319456101628e-12. An initial reviewer-probe error from taking the norm of a complex Ferrite Vec was corrected to use a collected Julia vector before rerunning.
  • julia --project --startup-file=no ../pec-probe.jl: 2 passed, exit 0. This exercises the frontend with explicit tangential trace conditions on all six PEC faces, avoiding the unavailable symbolic-normal constructor. On meshes n = 4, 8, 16, analytic manufactured-solution H(curl) rates were [0.9822585445071124, 0.9973372047607933]; L2 rates were [0.9899019163483727, 0.9974150863723549].
  • uv run --locked python --version: Python 3.15.0, with the warning that --locked has no effect outside a project. There is no uv.lock or pyproject.toml; this is not a locked project Python interpreter. No Python substitute was used for Julia testing.
  • git diff --check origin/master...HEAD and typos over the changed files reported no findings. Final git status --short was empty, and HEAD matched the SHA above.

What I did not verify

  • The symbolic facet-normal boundary path: PDEBase 0.1.41 has no applicable normal(::BoundaryPiece) method, and facet_normal throws its documented ArgumentError. The official PEC frontend convergence and boundary-rejection testsets skipped. The explicit-trace PEC convergence probe above does not exercise symbolic normal expressions.

  • Julia LTS/downgrade environments, the full All/Everything suites, or the documentation build. Dependencies were resolved from Project.toml rather than a checked-in lockfile.

  • PR body, comments, reviews and remote CI were deliberately not consulted. No GitHub writes, commits, pushes or checkout edits were made. All started commands have completed.

  • Verdict: CHANGES

  • Round: 1

  • Blocking priorities: P2, P2


🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

t and others added 9 commits November 11, 2026 23:54
model.jl conflict resolved keeping both sides; on 2-eigen the linear Lagrange table is the shared facet node table.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…acet normal, BigFloat omega range

First-order terms, couplings of the components and per-component coefficients of E, dt E and dtt E are tested for exact symbolic zero (with only unit-scale roundoff beyond it), and the coefficients are compared across the equations order by order, so a large reaction coefficient no longer hides them. facet_normal builds its own symbolic normal when PDEBase has none, so the perfect-conductor tests run unconditionally. FEMDiscretization judges omega after conversion to Float64. Review-history labels are removed from a test comment.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…ot representable

a0/omega^2 overflows or is 0/0 for tiny omega and gave NaN operators; it is now an ArgumentError.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…ation's own coefficients

The absolute tolerance of the symbolic fallback depended on how an equation was scaled; it is now 100 eps of the largest coefficient of the same equation.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Any tolerance relative to other coefficients, or to a unit, depends on how an equation is scaled and can hide a significant term, so a coefficient is zero only if it is symbolically zero or exactly zero at every cell centroid; also fixes the vertical concatenation of the scale list that the previous commit introduced.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
… eps

a0/omega^2 below the smallest normal number was silently dropped next to a dominant curl-curl term; now an ArgumentError.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@xtalax-droid

Copy link
Copy Markdown
Collaborator Author

Review feedback on this PR has been addressed on head 8bcc28d. Master was merged in first (merge commits only, no rebase or force-push), then each finding was fixed with a regression test, and a Codex review of the branch approved with no open findings. All named CI checks are green on this head, including the Documentation job, which had one re-run after the gh-pages deploy push was rejected by a concurrent job (the docs build itself succeeded).

Stacked on #74.

Items deliberately left as they are: reaction coefficients that are subnormal but representable are still rejected (conservative); coefficients that cancel to zero only up to roundoff are rejected rather than compared with a tolerance; the absorbing-boundary adjoint derivative uses 0 for the sigma term at omega = 0 although the true limit is finite and nonzero.

🤖 Posted by an AI agent · harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Review: unreviewed
Session: 43e03fde-3384-4386-bae9-03e81f19ba7c

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

Independent review (Codex CLI v0.164.0 / gpt-6.1-sol), reviewer session 01a1ceeb-945c-7b60-8a8e-3c01416a9de6, reviewed head 8bcc28d

  • Verdict: CHANGES
  • Risk assessment: medium (M1: adds a symbolic-vector method to Ferrite.curl; additive Maxwell API and numerical assembly).
  • Round / slot: 2 / 1

This is a blind code-only review by a session other than the PR author's, copied below from the reviewer's report with only the grading metadata removed. The posting agent did not re-run the reviewer's commands. A MERGE verdict is advice; merging is left to the maintainers.

CI: green
Session: 01a1ceeb-945c-7b60-8a8e-3c01416a9de6

Risk

medium (M1: adds a symbolic-vector method to Ferrite.curl; additive Maxwell API and numerical assembly).

Blocking findings

Review in progress; verdict pending executed checks.

Non-blocking findings

Pending.

What I ran

Risk recorded independently from the code diff before reading the provided previous-review.md.

What I did not verify

Pending.


🤖 Posted by an AI agent — harness: Claude Code 2.1.322 · model: claude-sonnet-5-5
Conversation: local session 3878b54e-28f2-4a01-a176-a8f5468d1997 (no session URL)

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #82

Reviewed head: 339563c
Raw SHA-256: 23370af42681dc5df708f51fb66e1a7de0fa08f3bbaca3b2f25481d1dadbae6b
Source SHA-256: 1c9f395af2a4558368164123f58b4ad00a92bba637a8f29cd9545327b2151857
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d1c7-b667-78a2-8df8-fba93b6b3ad7
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: CHANGES
  • Reviewed head: 339563c

Review report

VERDICT: CHANGES
Round: 3
Head: 339563c
Slot: 1
CI: green
Session: 01a1d1c7-b667-78a2-8df8-fba93b6b3ad7

Risk

medium (M1: adds a symbolic-vector method to Ferrite/Tensors.curl on foreign argument types, affecting another package's dispatch).

Blocking findings

  1. [P2] The prior anisotropy/cancellation blocker remains unresolved. src/maxwell/frontend.jl:237 still compares component coefficients with a tolerance proportional to their large individual magnitudes. The round-three delta changes only test/Maxwell/model.jl; this numerical path is unchanged.

    Confirmed by running: on the two-cells-per-side unit cube with natural boundaries, use omega = 2, nu = 1, a2 = 2.0^46, source (1,1,1), and component reaction coefficients 2.0^48 + c for c = 1:3. These coefficients and differences are exactly representable in Float64. Reaction and inertia cancel to give

    curl(curl(E)) + diag(1,2,3) E = (1,1,1).

    The exact constant solution is (1,1/2,1/3) and satisfies the natural boundary condition. The frontend accepts this unsupported anisotropic equation because differences of 1 and 2 pass a threshold of 6.250000000000067, then retains the first component's coefficient. The emitted matrix differs from the scalar K + M control by norm 0.0. Solving and evaluating at (0.31,0.37,0.41) returns approximately (1,1,1), with relative error 0.7142857142857025 against the analytic solution. Both the accuracy assertion and the expected-rejection assertion fail; the official suite passes.

    Compare symbolic component differences before sampling/conversion, without a tolerance scaled to coefficients that cancel at the requested frequency, and add this exact-power regression. Merely tightening that relative tolerance does not establish that discarded component differences are harmless.

Non-blocking findings

None. The delta at test/Maxwell/model.jl:155 removes calls to Ferrite's non-public facet-table helpers and verifies geometric membership and tangential traces instead. The revised tests pass. Targeted probes also reject eight deliberately incorrect facet-node/edge-table assignments, covering every facet.

What I ran

Independent AI review by codex-cli 0.164.0, model gpt-6.1-sol, local session ID above; no session URL available. I recorded the independent risk in this file before reading the explicitly supplied previous-round report. Scope: supplied delta and unresolved prior blocker, with the whole PR diff for context. Neither AGENTS.md nor CLAUDE.md exists at the checkout root; the supplied instructions were applied.

All Julia execution used an exact git archive HEAD snapshot in ../scratch/head, preserving the checkout. I exported the requested TMPDIR before commands and preserved the runtime's layered JULIA_DEPOT_PATH. Julia jobs ran sequentially in memory-capped scopes (MemoryMax=12G, MemoryHigh=infinity), with four Julia threads and four precompile tasks.

  • julia --version: 1.13.2. The repository has no checked-in Julia interpreter/dependency lock. Pkg.instantiate(; allow_autoprecomp=false) succeeded in the snapshot. Resolved versions included Ferrite 1.7.0, PDEBase 0.1.41, ModelingToolkit 11.46.1, Symbolics 7.48.0, SymbolicUtils 4.56.1, and SciMLBase 3.58.0.
  • GROUP=Maxwell julia --project=../scratch/head --startup-file=no -e 'using Pkg; Pkg.instantiate(;allow_autoprecomp=false); Pkg.status(); Pkg.test(; julia_args=["--threads=4", "--gcthreads=1"])': exit 0, 200 passed (frontend 98, manufactured 4, model 98), with no skipped/broken assertions reported. Frontend analytic PEC H(curl) convergence rates: 0.9822585445071127, 0.9973372047607929. Lossless and lossy manufactured-solution checks also passed. Output: ../scratch/maxwell-tests.log.
  • julia --project=../scratch/head --startup-file=no ../scratch/probes.jl: exit 1, 11 passed, 2 failed, 0 errored, 0 broken. Nine facet-membership probes passed, including eight incorrect-table negative controls. The scalar cancellation control passed; the anisotropic analytic accuracy and rejection assertions failed as described above. Probe source: ../scratch/probes.jl; output: ../scratch/probes.log.
  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. Neither uv.lock nor pyproject.toml exists, so this does not establish a locked project Python interpreter. No system Python substitute was used for tests.
  • git diff --check origin/master...HEAD, git diff --check 8bcc28d08628ed37368bec8ac51bf3ba73da0728..HEAD, and typos over changed files: exit 0, no findings. The delta contains only 26 additions and 3 deletions in test/Maxwell/model.jl. Final checkout status was clean and HEAD matched the requested SHA. All started commands completed.

What I did not verify

  • Julia LTS/downgrade environments, QA, the separate Frontend group, full All/Everything suites, documentation build, or execution at the previous head. Dependencies were resolved from Project.toml because no project lockfile exists.

  • Remote CI, PR body/comments, author risk assessment, same-head reviews, or issue-deferral evidence. CI: green is supplied task metadata. Only the expressly requested previous-round report was read. No GitHub posts/actions, commits, pushes, fixes, or checkout edits were performed.

  • Verdict: CHANGES

  • Round: 3

  • Blocking priorities: P2

  • Deferred P2 issues: None supplied or verified; deferral is not established.

AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":4,"rounds":3,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 200 Maxwell assertions pass, and the delta's geometric facet tests detect eight incorrect table assignments without non-public Ferrite helpers. The prior anisotropy blocker remains reproducible: an exactly representable cancellation case is silently reduced to an isotropic operator and produces 71.4% relative error against an analytic constant solution."}

Head link: 339563c


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d1c7-b667-78a2-8df8-fba93b6b3ad7 (no session URL)

The anisotropy check used a tolerance of 100 eps times the larger coefficient, so reactions 2^48 + c cancelling an inertia 2^46 at omega = 2 into diag(1, 2, 3) passed as isotropic and the equation was silently solved with one component's coefficient. Coefficients must now be equal as expressions or equal as numbers.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #82

Reviewed head: e25564c
Raw SHA-256: a9bd69e2a1f9a7b6adaf0c924c44057b4190f07b60e0ec3114d2255bc7156f99
Source SHA-256: a8dbde752fdab66457b35fa652c78026e84c02fccd1b69b183660fff9f065a7e
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d223-065a-7061-958f-38878d9719c6
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: MERGE
  • Reviewed head: e25564c

Review report

VERDICT: MERGE
Round: 4
Head: e25564c
Slot: 1
CI: CI is not green
Session: 01a1d223-065a-7061-958f-38878d9719c6

Risk

medium (M1: extends Ferrite/Tensors.curl for symbolic vectors of foreign types, affecting another package's dispatch).

Blocking findings

None. The prior cancellation/anisotropy blocker is resolved at src/maxwell/frontend.jl:240, with regression coverage at test/Maxwell/frontend.jl:226. Confirmed by running: the rejection assertion fails on the previous head and passes on this head.

Non-blocking findings

None.

What I ran

Independent AI review using codex-cli 0.164.0, model gpt-6.1-sol, local session above (no session URL). Risk was recorded before any author rating. I read the supplied previous-round report, the whole PR diff for context, and the two-file delta; investigation focused on that delta and the prior blocker. Neither AGENTS.md nor CLAUDE.md exists at the checkout root.

Tests used exact git archive snapshots under ../scratch, the requested exported TMPDIR, and the runtime's unchanged layered JULIA_DEPOT_PATH. Julia jobs ran sequentially in memory-capped scopes (MemoryMax=12G, MemoryHigh=infinity), with four Julia threads and four precompile tasks. Probes additionally used OPENBLAS_NUM_THREADS=1.

  • julia --version: 1.13.2. No checked-in Julia interpreter or dependency lock exists. Instantiation in the head snapshot succeeded; resolved packages included Ferrite 1.7.0, ModelingToolkit 11.46.1, PDEBase 0.1.41, SciMLBase 3.58.0, Symbolics 7.48.0, and SymbolicUtils 4.56.1.
  • GROUP=Maxwell julia --project=../scratch/head --startup-file=no -e 'using Pkg; Pkg.instantiate(; allow_autoprecomp=false); Pkg.status(); Pkg.test(; julia_args=["--threads=4", "--gcthreads=1"])': exit 0, 201 passed (frontend 99, manufactured 4, model 98), with no skipped/broken assertions reported. Analytic PEC H(curl) convergence rates were 0.9822585445071127 and 0.9973372047607929. Lossless and lossy manufactured checks passed. Log: ../scratch/maxwell-tests.log.
  • julia --project=../scratch/head --startup-file=no ../scratch/probes.jl: exit 0, 13 passed. The cancellation case is rejected after multiplying the equation by each of 2^-80, 1, and 2^80. One-ulp component differences in reaction, damping, and inertia are rejected. Algebraically equivalent expressions and distinct expressions with equal values throughout the domain are accepted, exercising both equality paths. A valid scalar cancellation case gives the analytic constant field (0.5,1,1.5) with relative errors 3.1874920949220034e-15 and 3.67836556159502e-15 at two interior points. Log: ../scratch/probes.log.
  • julia --project=../scratch/before --startup-file=no ../scratch/regression.jl, using an archive of 339563c and the same resolved dependency manifest: exit 1, one expected failed assertion; the unsupported anisotropic equation was accepted. The identical command with --project=../scratch/head: exit 0, the assertion passes with the anisotropy diagnostic. Logs: ../scratch/regression-before.log and ../scratch/regression-after.log.
  • uv run --locked python --version: Python 3.15.0, with warning that --locked has no effect outside a project. Neither uv.lock nor pyproject.toml exists, so this is not a locked project Python environment. No system Python substitute was used for testing.
  • git diff --check origin/master...HEAD, git diff --check 339563cd51b3300f3e13b545d30a512c1f8bcc30..HEAD, and typos over all changed files: exit 0, no findings. Checkout status is clean and HEAD matches the requested SHA. All started commands completed.

What I did not verify

  • Julia LTS/downgrade environments, QA, other test groups, full All/Everything suites, or documentation builds. Dependency resolution follows Project.toml rather than a supplied lockfile.

  • Remote CI, PR body/comments, author risk ratings, same-head reviews, or issue-deferral evidence. The CI header is supplied metadata. Only the expressly supplied previous-round report was read. No checkout edits, commits, pushes, or GitHub actions were performed.

  • Verdict: MERGE

  • Round: 4

  • Blocking priorities: None

  • Deferred P2 issues: None; no blockers require deferral.

AUTHOR_GRADE: {"task":"feature","score":5,"difficulty":4,"rounds":4,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"The delta resolves the prior anisotropy/cancellation blocker: an identical rejection assertion fails before and passes after. All 201 Maxwell assertions and 13 targeted assertions pass, including rescaling, one-ulp differences, both equality paths, and a valid scalar cancellation case checked against an analytic constant field."}

Head link: e25564c


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d223-065a-7061-958f-38878d9719c6 (no session URL)

@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #82

Reviewed head: e25564c
Raw SHA-256: 56b8c4cc195008daa4521550aca1eff8e06ef82a02f4cf3bd95cadc349023c70
Source SHA-256: 97feddb6940422de00c287a6169434855f11bf6058082ac683ae158f4d563ed5
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d2af-e9e8-7b02-ae2f-22e9ea453f5e
Slot: 2
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: CHANGES
  • Reviewed head: e25564c

Review report

VERDICT: CHANGES
Round: 5
Head: e25564c
Slot: 2
CI: green
Session: 01a1d2af-e9e8-7b02-ae2f-22e9ea453f5e

Risk

medium (M1: adds a method to Ferrite/Tensors' public curl function; also adds the documented Maxwell API, ML7).

Blocking findings

  • Verdict: CHANGES
  • Round: 5
  • Blocking priorities: P1, P1, P2
  • Deferred P2 issues: Not supplied; no deferral evaluated in this blind review.
  1. [P1] Reaction conversion changes a supported equation's answer by 11.1%. src/maxwell/frontend.jl:375 computes a2 - a0/ω² before reconstructing the reaction through -ω²*eps_r. Confirmed by running with ω = 3, a2 = 2.0^49, a0 = 9*a2 + 1, ν = 1, source [1, 0, 0], and natural boundaries. These inputs are exactly representable, and a0 - 9*a2 = 1 exactly, so the constant field [1, 0, 0] is an exact solution representable in the Nédélec space. The conversion instead produces eps_r = -0.125, hence reaction 1.125. Solving and evaluating the field returned [0.888888888888886, 2.78e-16, 3.00e-15], with relative error 0.11111111111111405. Assemble the net reaction coefficient without this cancellation-prone permittivity conversion, and add a constant-field accuracy regression with these coefficients. The existing large-coefficient acceptance tests do not check the resulting answer.

  2. [P1] Large curl coefficients hide unsupported second-order terms, which are silently discarded. src/maxwell/frontend.jl:171 scales the structural checks by maximum(abs, B). With ν = 1e12, the tolerance is about 100; adding either -ΔE or -grad(div(E)) with coefficient 1 passes the checks at lines 174 and 183. Confirmed by running both cases on a 2×2×2 tetrahedral cube: each was accepted, and each returned an operator exactly equal to the unmodified equation's operator (diff_norm = 0.0). These are significant terms on the gradient kernel of curl-curl, regardless of their size relative to ν, and the documented Nédélec path cannot represent them. Reject nonzero structural residuals using symbolic checks or coefficient comparisons that cannot hide them behind ν. Add rejection regressions for both terms beside large ν, including a uniformly rescaled equation.

  3. [P2] A condition at one time is silently promoted to a PEC wall. src/maxwell/frontend.jl:277 replaces a field trace solely by its operator, discarding its arguments. Confirmed by passing cross(facet_normal(Γ), [E(0, Γ)[c] for c in 1:3]) .~ 0 on the left face: maxwell_model accepted it and returned pec = ["left"]. This constrains the frequency-domain field on that wall, although the supplied condition only constrains the time-domain trace at time zero. The documented contract rejects initial conditions. Validate the trace's time argument before substitution, and reject fixed or otherwise unsupported time arguments; add a boundary-trace initial-condition regression.

Non-blocking findings

  • .github/workflows/Tests.yml:4, .github/workflows/Downgrade.yml:3, .github/workflows/benchmark.yml:3: the diff also removes PR target-branch filters. This is an independent CI policy change alongside the Maxwell feature. Move it to a separate focused PR under the supplied author instructions. This observation is from the diff; I did not exercise GitHub event dispatch.

What I ran

  • Read git diff origin/master...HEAD, the affected implementation/tests/docs, and the required risk criteria, without inspecting PR discussion, author ratings, or earlier reviews. Confirmed the requested head and newest commit's attribution trailers.
  • julia --version: Julia 1.13.2. Created a scratch dependency environment from the checkout's dependency/extras/compat declarations, developed this checkout there, and instantiated it without editing the checkout. Preserved the supplied layered JULIA_DEPOT_PATH; used the requested TMPDIR, two Julia threads, two precompile tasks, one BLAS thread, and an 8 GiB scope. Resolved Ferrite 1.7.0, ModelingToolkit 11.46.1, PDEBase 0.1.41, SciMLBase 3.58.0.
  • julia --startup-file=no --project=../scratch/env ../scratch/run_affected.jl: all three Maxwell files under isolated SafeTestsets, 201/201 passed; existing Frontend arguments, errors, steady, symbolic, and operators tests, 167/167 passed. Exit 0. The initial scratch wrapper had an out-of-scope repo variable; I corrected that wrapper and reran it successfully. No repository test was changed.
  • Manufactured H(curl) convergence rates were 0.9821, 0.9973 (lossless), 0.9670, 0.9932 (lossy), and 0.9823, 0.9973 (frontend). The two-material frontend/operator matrix comparison had relative error 0.0; load error was 1.08e-16.
  • julia --startup-file=no --project=../scratch/env ../scratch/probes.jl: exit 0; the diagnostic probes printed the three reproduced failures above. Also checked unequal curl coefficients and a constant SI field with centimetre mesh units; the latter had relative field error 2.07e-13. Probe exit 0 means the diagnostic script completed, not that the reproduced failures passed assertions.
  • uv run --locked python --version: Python 3.15.0, with uv's warning that --locked has no effect outside a project. There is no Python project/uv.lock or Julia Manifest/interpreter pin in this checkout; the Julia checks used the scratch-resolved environment described above.
  • git diff --check origin/master...HEAD: clean. Final git status --porcelain: empty. Both launched command sessions finished; no commits, pushes, GitHub posts, or checkout edits.

What I did not verify

  • Full All/Everything, QA, documentation build, other Julia versions/platforms, or downstream suites.
  • GitHub CI execution or issue deferrals; CI: green is supplied review metadata. No PR body, comments, reviews, sibling review artifacts, or author risk rating were read.

AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":4,"rounds":5,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 201 Maxwell and 167 affected existing frontend assertions passed, including independent manufactured-solution convergence. Targeted runtime probes nevertheless reproduced an 11.1% error in a supported scalar reaction equation, discarded second-order terms, and a time-slice boundary condition promoted to PEC."}

REVIEWER_GRADE: {"task":"feature","score":2,"rounds":5,"reviewer_harness":"codex","reviewer_model":"gpt-6.1-sol","verdict":"missed","note":"The earlier review supplied concrete failing-before/passing-after evidence for the anisotropy fix and 201 passing Maxwell assertions, but its MERGE verdict missed three same-head runtime failures in the frozen independent report: 11.1% reaction error, silently discarded second-order terms beside large curl coefficients, and a time-zero boundary trace promoted to PEC."}

Head link: e25564c


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d2af-e9e8-7b02-ae2f-22e9ea453f5e (no session URL)

…ents

The reaction a2 - a0/omega^2 cancelled badly for large coefficients (relative error 0.11 on an exact constant field); the net a0 - omega^2 a2 is now formed in extended precision and divided once. The structural checks (grad div E, vector Laplacian, anisotropy, component choice) compared against a tolerance scaled by the largest coefficient, so -Laplacian E with coefficient 1 next to nu = 1e12 passed; they are decided symbolically from each term's own coefficient. The trace E(t, Gamma) of a boundary condition must use the time variable and its piece, so a condition at one time is no longer taken as a perfect conductor. The perfect-conductor rows are judged by their own norm.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
t and others added 2 commits November 13, 2026 03:16
With omega = 1e154, a0 = 5 and a2 = 5e-308 the net reaction a0 - omega^2 a2 is 8.4e-17 but eps_r = -net/omega^2 underflows to zero and the reaction was silently dropped. The coefficient and the reaction assembly forms from it are checked against the exact net value, and a nonzero net that becomes zero, subnormal or non-finite is an ArgumentError.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
The cancellation used BigFloat at the caller's precision, so inside setprecision(BigFloat, 53) an exact net reaction of -1 (omega = 1 + 2^-30, a2 = 2^60, a0 = 2^60 + 2^31) rounded to zero and the reaction was dropped. The Float64 inputs are now combined as Rational{BigInt}, which is exact at any precision.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #82

Reviewed head: 20ca571
Raw SHA-256: b153ea7bd60ebdba1e2f1e8d2abef650657fa97c425d1c859fb84f7fb583a6c4
Source SHA-256: 263e6621121344c965da3177277ec7e80d4ca8aa36270844db6a43197921f329
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d340-cf1f-7620-8b4a-4f559c2bcdc0
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: CHANGES
  • Reviewed head: 20ca571

Review report

VERDICT: CHANGES
Round: 6
Head: 20ca571
Slot: 1
CI: CI is not green
Session: 01a1d340-cf1f-7620-8b4a-4f559c2bcdc0

Risk

medium (M1: adds a method to Ferrite/Tensors' curl function; the documented additive Maxwell API also matches ML7).

Blocking findings

  • Verdict: CHANGES
  • Round: 6
  • Blocking priorities: P2
  • Deferred P2 issues: None supplied; no issue deferral established in this blind review.
  1. [P2] The reaction-conversion guard still accepts substantial precision loss when ω² is subnormal. src/maxwell/frontend.jl:403 reconstructs the reaction using the rounded Float64 square, but line 405 checks only finiteness and whether the resulting coefficients are zero or subnormal. Confirmed by running with ω = 2e-162, ν = 1e-30, a₂ = 1e308, a₀ = 0, natural boundaries, and source [-4e-16, 0, 0] on the unit cube. The source is the once-rounded exact reaction; the analytic constant solution rounds to [1, 0, 0] in Float64. Although the rational net reaction rounds to -4e-16, assembly reconstructs -4.9406564584124655e-16 because ω² rounds to 5e-324. Both ε and the reconstructed reaction pass the new guard. The solved field is [0.8096090132292426, 5.55e-17, 1.32e-17]: 19.04% field error, with 23.52% coefficient error. This also fails on the previous head, so the reaction-conversion blocker remains incomplete for this extreme supported regime. Assemble the net reaction without this loss of precision, or explicitly reject the regime; add this constant-field regression.

Non-blocking findings

  • .github/workflows/Tests.yml:4, .github/workflows/Downgrade.yml:3, .github/workflows/benchmark.yml:3: the full PR also changes pull-request branch filters, a separate CI concern under the author's focused-PR instructions. Split those edits into a separate PR. Observed in the diff; GitHub event dispatch was not exercised.

What I ran

  • Reviewer: Codex, model gpt-6.1-sol. Read the whole PR diff, supplied delta and previous-head review, affected code/tests, and risk criteria. Confirmed the requested head and newest commit's attribution trailers. PR discussion, author risk ratings and earlier same-head opinions were not inspected.
  • julia --version: Julia 1.13.2. Built a scratch environment from the checkout's dependency, extras and compat declarations, with this checkout as a path dependency. Resolved Ferrite 1.7.0, Tensors 1.17.2, ModelingToolkit 11.46.1, PDEBase 0.1.41, SciMLBase 3.58.0. Preserved JULIA_DEPOT_PATH; used the requested TMPDIR/scratch, two Julia threads, two precompile tasks, one BLAS thread and an 8 GiB scope. Host-capacity waits preceded execution.
  • uv run --locked python --version: Python 3.15.0; uv warned that --locked has no effect outside a project. There is no Python project/uv.lock or Julia Manifest/interpreter pin in the checkout. Julia checks used the scratch-resolved dependency snapshot.
  • julia --startup-file=no --compiled-modules=existing --check-bounds=yes --project=../scratch/env ../scratch/run_affected.jl: official test/runtests.jl with GROUP=Maxwell completed 217/217 assertions: frontend 115, manufactured 4, model 98. H(curl) convergence rates were 0.9823, 0.9973 (frontend), 0.9821, 0.9973 (lossless), 0.9670, 0.9932 (lossy). Two-material matrix relative error was 0.0, load relative error 1.08e-16.
  • That wrapper then stopped in the additional existing frontend arguments tests: 11 passed, 2 errored, exit 1, with UndefVarError: reference_edges not defined in Ferrite. A standalone Ferrite grid/DofHandler/Dirichlet probe reproduced the same error before FiniteElementMethod was loaded, in both subsequent probe processes.
  • Ran probes.jl with the same Julia flags/dependencies against scratch source at e25564c49634100961e15e14161cbadac3552793 and against the current checkout. Previous head: 9 failed, 2 errored; current head: 10 passed, 1 failed; both exit 1. The original ω=3 cancellation case improved from 11.11% field error to 2.02e-15. The dyadic cancellation solve passed at BigFloat precisions 53 and 256 with 3.40e-15 field error. Large-ν Laplacian/grad-div rejection, fixed/shifted/scaled-time trace rejection, and independently scaled PEC-row checks passed on the current head. Only the subnormal-square reaction probe remains failing.
  • git diff --check origin/master...HEAD: clean. Final checkout status: clean; head unchanged. All launched command sessions finished. No commits, pushes or GitHub posts.

What I did not verify

  • Full All/Everything, QA, documentation build, other Julia versions/platforms or downstream suites. The extra frontend errors/steady/symbolic/operators checks after arguments were not reached because that wrapper stopped on the Ferrite error.
  • GitHub CI execution or issue-deferral evidence. The CI header is supplied metadata. No project-locked interpreter/dependency environment was available; validation used the versions recorded above.

AUTHOR_GRADE: {"task":"feature","score":4,"difficulty":4,"rounds":6,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 217 Maxwell assertions passed. Paired runtime probes confirm the three prior fixes and boundary-row scaling improvements, but the reaction guard still accepts a subnormal frequency square that produces a 19.04% field error. Additional frontend validation encountered a standalone-reproducible Ferrite error."}

Head link: 20ca571


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d340-cf1f-7620-8b4a-4f559c2bcdc0 (no session URL)

With omega = 2e-162 the square rounds to the subnormal 5e-324, so assembly formed -4.94e-16 for an exact net reaction of -4e-16 (19% field error) while both eps_r and the reconstructed reaction were finite and nonzero. The reaction assembly forms (with omega squared rounded as it rounds it) is now compared with the exact rational net to 1e-10, and a subnormal omega squared or coefficient with a nonzero net is rejected.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
@ChrisRackauckas

Copy link
Copy Markdown
Member

🤖 Automated comment from an AI agent running as @ChrisRackauckas — not written or reviewed by Chris.

PR: #82

Reviewed head: 732f87c
Raw SHA-256: a982e70b449b893ae20e25adba23fc1aaf4bd0c1cde3a7654743617ffafee6c7
Source SHA-256: 6362b84d191e5818d31f15af5ec60562f0b28a1ad27e0e0ac06aa05390ccee44
Source: standard-review-v1 (harness-log)
Reviewer session: 01a1d3ae-5b71-7573-a7bd-fed097eaa66b
Slot: 1
Confidence: unknown
Own risk fixed before author rating/discussion: yes

Risk assessment

  • Risk: medium (M1)
  • Verdict: CHANGES
  • Reviewed head: 732f87c

Review report

VERDICT: CHANGES
Round: 7
Head: 732f87c
Slot: 1
CI: CI is not green
Session: 01a1d3ae-5b71-7573-a7bd-fed097eaa66b

Risk

medium (M1: the full PR adds a method to Ferrite/Tensors' curl function; the documented additive Maxwell API also matches ML7).

Blocking findings

  • Verdict: CHANGES
  • Round: 7
  • Blocking priorities: P2
  • Deferred P2 issues: None supplied; no issue deferral established in this blind review.
  1. [P2] Restore the rejection of a subnormal reconstructed reaction. src/maxwell/frontend.jl:406 checks whether ω² and ε are subnormal but drops the preceding head's corresponding check on reaction. Confirmed by running both heads: on a unit cube with two cells per axis, natural boundaries, ω = 2.0^-511, ν = 1e-307, a₀ = 2.0^-1074, a₂ = a₁ = 0, and f = [a₀, 0, 0], the preceding head rejects the conversion. This head accepts it: ω² is the smallest normal Float64, ε is the normal value -2.0^-52, and the scalar reaction round trip is exact. Nevertheless, assembly rounds away the entire reaction matrix and load: A == model.blocks.curlcurl and every load entry is zero. Solving returns [0, 0, 0] at (0.31, 0.37, 0.41), while the analytic constant solution is [1, 0, 0] (100% field error). The scalar accuracy comparison cannot prevent this underflow during integration and matrix scaling. Retain the nonzero-reaction subnormal rejection alongside the new round-trip check, or provide an assembly representation that preserves the equation. Add this regression with either explicit rejection or an independently accurate constant-field solve.

Non-blocking findings

  • Unchanged prior note: .github/workflows/Tests.yml:4, .github/workflows/Downgrade.yml:3, .github/workflows/benchmark.yml:3 broaden pull-request branch filters, a separate concern under the author's focused-PR instructions. Split these edits into a separate PR. Observed in the whole PR diff; event dispatch was not exercised.

What I ran

  • Reviewer: Codex CLI 0.164.0, model gpt-6.1-sol. Session above comes from the runtime's session identifiers; no published session URL was available. Read the supplied preceding-head review, delta, whole PR diff, affected code/tests and risk criteria. No PR body, discussion, author risk rating or earlier same-head review was inspected.
  • julia --version: Julia 1.13.2. uv run --locked python --version: Python 3.15.0, with uv's warning that --locked has no effect outside a project. The checkout supplies no Python project/uv.lock, Julia Manifest or pinned Julia interpreter. Built a scratch environment from its dependency, extras and compat declarations, with the checkout as a path dependency. Resolved Ferrite 1.7.0, Tensors 1.17.2, ModelingToolkit 11.46.1, PDEBase 0.1.41, SciMLBase 3.58.0, SciMLTesting 2.13.3.
  • Preserved the runtime's layered JULIA_DEPOT_PATH; used the requested TMPDIR and scratch directory, two Julia threads, two precompile tasks, one BLAS thread and an 8 GiB scope. Capacity checks included memory, Julia process counts and /proc/loadavg.
  • GROUP=Maxwell julia --startup-file=no --compiled-modules=existing --check-bounds=yes --project=../scratch/env test/runtests.jl: exit 0, 218/218 assertions (frontend 116, manufactured 4, model 98). H(curl) convergence rates were 0.9823, 0.9973 for the frontend, 0.9821, 0.9973 lossless and 0.9670, 0.9932 lossy. Two-material matrix relative error was 0.0, load relative error 1.08e-16.
  • julia --startup-file=no --compiled-modules=existing --check-bounds=yes --project=../scratch/env ../scratch/probes.jl, and the same command with --project=../scratch/oldenv against scratch source at 20ca57129514ba424b4f2ecd30d6dd42240c73fe: each exited 1, with 7 passed, 1 failed, on different cases. The prior ω=2e-162 blocker produced 19.04% field error on the preceding head and is correctly rejected on this head. The newly accepted subnormal-reaction case above passed its rejection assertion before the delta and fails afterward. Three normal/cancellation cases at BigFloat precisions 53 and 256 passed on both heads, with maximum field error 7.89e-15. Probe logs identify the actual loaded source paths.
  • git diff --check origin/master...HEAD: clean. Checkout status remained clean and HEAD unchanged. All commands finished; no commits, pushes or GitHub posts.

What I did not verify

  • All/Everything, QA, other frontend groups, documentation build, other Julia versions/platforms or downstream suites. The preceding review's extra frontend/Ferrite failure was not rerun; this review focuses on the delta and prior blocker.
  • GitHub CI execution or issue-deferral evidence. The CI header is supplied metadata. A project-locked interpreter/dependency environment was unavailable; Julia checks used the recorded scratch-resolved snapshot, shared unchanged between the paired runs.

AUTHOR_GRADE: {"task":"feature","score":3,"difficulty":4,"rounds":7,"author_harness":"Claude Code 2.1.322","author_model":"claude-sonnet-5-5","note":"All 218 Maxwell assertions pass and the prior 19.04% field-error case is rejected. Paired runtime probes establish that the delta drops the subnormal-reaction rejection, accepting an equation whose assembled reaction and source both vanish and whose computed field has 100% error."}

Head link: 732f87c


🤖 Posted by an AI agent — harness: codex-cli 0.164.0 · model: gpt-6.1-sol
Conversation: local session 01a1d3ae-5b71-7573-a7bd-fed097eaa66b (no session URL)

t and others added 6 commits November 13, 2026 07:13
With omega = 2^-511, nu = 1e-307 and a0 = 2^-1074 every scalar round trip is exact, yet the assembled reaction block and the load round to zero (100% field error). A subnormal reconstructed reaction is rejected again, and the assembled reaction entries and the load are checked for underflow to zero or subnormal values whenever the net reaction or a source is nonzero.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…tude and omega

Extreme-scale underflow cases were found one at a time (conductivity block, ε from the net reaction, ω squared, the assembled reaction and load). Every nonzero nu, a0, a1, a2 and source amplitude and omega must now lie in 1e-100..1e100 and the products ω² a2 and ω a1 in 1e-250..1e250, far wider than SI-unit physics, so that products with mesh quantities cannot underflow; outside it an ArgumentError names the coefficient and the window and asks for a nondimensionalised equation. The exact, round-trip and assembly checks stay as defence in depth. The window is documented in the maxwell_model docstring and the manual, with a copper-conductivity SI example as a regression.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A source supported between the quadrature points integrates to an exactly zero load without any arithmetic underflow, and the window already keeps sources and mesh quantities from underflowing, so the check of the final load vector is removed. The assembled reaction check stays: it only looks at entries that are nonzero in the unscaled block.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…after conversion

The window check saw only the cell centroids, so a source supported around a quadrature point with a huge or subnormal amplitude bypassed it, and a finite BigFloat 1e400 passed the finiteness test before becoming Inf as a Float64. The load assembly now evaluates a validated source (window on every value) and values are converted to Float64 before the finiteness test.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
…sion

BigFloat 1e-400 became an exact 0.0 before the window check, which exempts zero, so a nonzero source, reaction, conductivity or nu was silently erased. The shared conversion now rejects a nonzero value whose Float64 is zero or subnormal with the window error, after the finiteness test on the converted value.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
A parameter given as BigFloat 1e-400 became an exact 0.0 in _parameter_values before the coefficient and source checks, so a parameterised source, reaction or conductivity was silently erased, and 1e400 became Inf. The values are checked at the entry of the Maxwell front end: a nonzero value that converts to zero or subnormal is a window error naming the parameter, a non-finite one a finiteness error.

Agent-Harness: Claude Code 2.1.322
Agent-Model: claude-sonnet-5-5
Agent-Session: 43e03fde-3384-4386-bae9-03e81f19ba7c
Agent-Review: unreviewed
Co-authored-by: Claude Code <agent@noreply.juliahub.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants